/**
 * This class is the main view for the application. It is specified in app.js as the
 * "mainView" property. That setting automatically applies the "viewport"
 * plugin causing this view to become the body element (i.e., the viewport).
 *
 * TODO - Replace this content of this view to suite the needs of your application.
 */
Ext.define('OrderConvert.view.main.Main', {
    extend: 'Ext.tab.Panel',
    xtype: 'app-main',

    requires: [
        'Ext.plugin.Viewport',
        'Ext.window.MessageBox',
        'OrderConvert.view.main.MainController',
        'OrderConvert.view.main.MainModel',
        'OrderConvert.view.main.List',
        'OrderConvert.view.order.Order',
        'OrderConvert.view.log.LogGrid',
        'OrderConvert.view.convert.ConvertGrid',
        'OrderConvert.view.log.SyslogMain',
        'OrderConvert.view.order.pdf',
        'OrderConvert.view.order.xls'
    ],

    controller: 'main',
    viewModel: 'main',

    ui: 'navigation',

    tabBarHeaderPosition: 1,
    titleRotation: 0,
    tabRotation: 0,

    header: {
        layout: {
            align: 'stretchmax'
        },
        title: {
            bind: {
                text: '{name}'
            },
            flex: 0
        },
        iconCls: 'fa-th-list'
    },

    tabBar: {
        flex: 1,
        layout: {
            align: 'stretch',
            overflowHandler: 'none'
        }
    },

    responsiveConfig: {
        'width <= 1100': {
            headerPosition: 'bottom'
        },
        'width > 1100': {
            headerPosition: 'left'
        }
    },

    defaults: {
       bodyPadding: "10px 10px 0 10px",
        layout : 'fit',
        tabConfig: {
            plugins: 'responsive',
            responsiveConfig: {
                'width > 1100': {
                    iconAlign: 'left',
                    textAlign: 'left'
                },
                'width <= 1100': {
                    iconAlign: 'top',
                    textAlign: 'center',
                    width: 140
                }
            }
        }
    },

    items: [{
        title: '订单在线解析',
        iconCls: 'fa-list',
        // The following grid shares a store with the classic version's grid as well!
        items: [{
            xtype: 'mainlist'
        }]
    },{
        title: 'PDF管理',
        iconCls: 'fa-file-excel-o',
        items : [{
            xtype : 'pdf'
        }]
    },{
        title: '在线表格管理',
        iconCls: 'fa-file-excel-o',
        items : [{
            xtype : 'xls'
        }]
    }, {
        title: '转换规则管理',
        iconCls: 'fa-superscript',
        items : [{
            xtype : 'convertmain'
        }]
    },{
        title: '日志审计',
        iconCls: 'fa-users',
        items : [{
            xtype : 'loggridmain'
        }]
    },  {
        title: '系统日志',
        hidden : true,
        iconCls: 'fa-users',
        items : [{
            xtype : 'syslogmain'
        }]
    }],
    
    initComponent : function () {

        this.callParent();
    }
});
